'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 2_create_self_tools.py
* @Time: 2025/10/15
* @All Rights Reserve By Brtc
'''
from langchain_core.tools import  tool
from pydantic import Field, BaseModel

"""
class CaculatorInput(BaseModel):
    a: int = Field(description="第一个参数")
    b: int = Field(description="第二个参数")



@tool("multiply_toll", args_schema=CaculatorInput, return_direct=True, description="hello")
def multiply(a:int, b:int) ->int:
    return a*b
"""
@tool(parse_docstring=True)
def multiply(a:int, b:int) ->int:
    """ The  multiply_tool.

    Args:
        a:第一个参数.
        b:第二个参数.
    """
    return a*b

print("函数名称", multiply.name)
print("函数描述", multiply.description)
print("函数参数", multiply.args)
print("是否直接返回", multiply.return_direct)

print(multiply.invoke({"a":2, "b":3}))

